<template>
  <div class="app-container">
      <SelectCustom v-if="!custData.id" @confirm="toAddOrEdit"/>
      <Main :custId="custData.id" pageType="add" v-else/> 
  </div>
</template>

<script setup name="businessAdd">
import useBusinessStore from '@/store/modules/business'
import SelectCustom from '@/components/SelectCustom.vue'
import Main from './Main.vue'

const custData =  computed(() => useBusinessStore().custData);
const toAddOrEdit = custInfo => {
  useBusinessStore().setCustData(custInfo)
  console.log(toRaw(custData.value));
}
</script>

<style lang="scss" scoped>
</style>